package com.xmb.wechat.view.wechat.chat;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.text.TextUtils;
import android.widget.TextView;

import com.xmb.wechat.R;
import com.xmb.wechat.R2;
import com.xmb.wechat.base.BaseActivity;
import com.xmb.wechat.delegate.GroupCallDetailDelegate;
import com.xmb.wechat.entity.GroupCallEntity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * @Author lijiangop
 * @CreateTime 2020/4/29 14:37
 */
public class WechatGroupCallDetailActivity extends BaseActivity {

    @BindView(R2.id.tv_time)
    TextView mTvTime;
    private GroupCallDetailDelegate mDelegate;

    public WechatGroupCallDetailActivity() {
        super(R.layout.activity_wechat_group_call_detail);
        isChangeStatusBarTxtColor = false;
    }

    public static void start(Activity act, List<GroupCallEntity> list, String strTime) {
        ArrayList<GroupCallEntity> data = new ArrayList<>();
        data.addAll(list);
        Intent it = new Intent(act, WechatGroupCallDetailActivity.class);
        it.putParcelableArrayListExtra("data", data);
        it.putExtra("strTime", strTime);
        act.startActivity(it);
    }

    @Override
    protected void initView() {
        setStatusBarColor(Color.parseColor("#000000"));
        setNavigationColor(Color.parseColor("#f7f7f7"));

        mDelegate = new GroupCallDetailDelegate(WechatGroupCallDetailActivity.this);

        ArrayList<GroupCallEntity> data = getIntent().getParcelableArrayListExtra("data");
        if (data != null)
            mDelegate.addData(data);

        String strTime = getIntent().getStringExtra("strTime");
        mTvTime.setText(TextUtils.isEmpty(strTime) ? "" : strTime);
    }
}
